import request from '@/api/request/index'
import type {
  PageDataFanKuiLiShi,
  FenYeJiChu_1,
  PageDataFanKuidto,
  ChaXunFanKui,
  HuiFuFanKui,
  GengXinFanKuiZhuangTai
} from './_interfaces.ts'

/** 添加用户反馈 */
export function userFeedbackAddFeedback(data: {
  // 反馈类型 1-留言 2-故障 3-建议
  feedbackType?: number
  // 文件
  files?: File[]
  // 留言内容
  message?: string
}): Promise<string> {
  return request.post('/api/userFeedback/addFeedback', data)
}

/** 查询反馈历史 */
export function userFeedbackQueryHisFeedback(data: FenYeJiChu_1): Promise<PageDataFanKuiLiShi> {
  return request.post('/api/userFeedback/queryHisFeedback', data)
}

/** 查询反馈列表 */
export function userFeedbackQueryList(data: ChaXunFanKui): Promise<PageDataFanKuidto> {
  return request.post('/api/userFeedback/queryList', data)
}

/** 回复反馈 */
export function userFeedbackReplyFeedback(data: HuiFuFanKui): Promise<any> {
  return request.post('/api/userFeedback/replyFeedback', data)
}

/** 更新反馈状态 */
export function userFeedbackUpdateState(data: GengXinFanKuiZhuangTai): Promise<any> {
  return request.post('/api/userFeedback/updateState', data)
}
